package com.nbsaas.boot.order.rest.convert;

import com.nbsaas.boot.order.data.entity.OrderItem;
import com.nbsaas.boot.order.api.domain.simple.OrderItemSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class OrderItemSimpleConvert implements Converter<OrderItemSimple, OrderItem> {




@Override
public OrderItemSimple convert(OrderItem source) {
    OrderItemSimple result = new OrderItemSimple();

                result.setTotal(source.getTotal());
                result.setProductId(source.getProductId());
                result.setPrice(source.getPrice());
                result.setNum(source.getNum());
                result.setActualAmount(source.getActualAmount());
                result.setTotalDiscount(source.getTotalDiscount());
                result.setId(source.getId());
                result.setAddDate(source.getAddDate());
                result.setProductName(source.getProductName());
                result.setParentId(source.getParentId());
                if(source.getOrder()!=null){
                    result.setOrder(source.getOrder().getId());
                }
                result.setLastDate(source.getLastDate());


    return result;
}

}